<?php

namespace app\common\validate;

//引用tp的验证器
use think\Validate;

class Admin extends Validate
{
    //验证规则
    protected $rule = [
        'username'  => 'require',
        'nickname'  => 'require',
        'password'   => 'require',
    ];

    //提示信息
    protected  $message = [
        'username.require' => '用户名必须填写',
        'nickname.require' => '昵称必须填写',
        'password.require' => '密码必须填写',
        'password.length'     => '密码必须6~12个字符',
    ];

    //验证场景
    protected $scene = [
        'add' => ['username', 'password'],
        'edit' => ['email'],
    ];
}
